package dao;

import java.util.List;

public interface DAO<T> {
 
	/**
	 * Returns list of all the T objects contained in the database
	 * @return list of all the T objects contained in the database
	 */
	public abstract List<T> list();
	
	/**
	 * Deletes the bean object from the database
	 * @param bean - object to be deleted
	 * @return true if bean was deleted, false if wasn't
	 */
	public abstract boolean delete(T bean);
	/**
	 * Updates the bean object in the database
	 * @param bean - object to be updated
	 * @return true if bean was updated, false if wasn't
	 */
	
	public abstract boolean update(T bean);
	
	/**
	 * Saves the bean object in the database
	 * @param bean - object to be saved
	 * @return true if bean was saved, false if wasn't
	 */
	public abstract boolean save(T bean);
	
	/**
	 * Checks if the object bean is in the database
	 * @param bean
	 * @return true if bean is in the database, false if isn't
	 */
	public abstract boolean contains(T bean);
}
 
